//
//  XRAFNetworkTool.h
//  框架TEST1
//
//  Created by dllo on 15/12/9.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>


typedef NS_ENUM(NSUInteger, XRResponseStyle) {
    XRJSON,
    XRXML,
    XRDATA,
};

typedef NS_ENUM(NSUInteger, XRRequestStyle) {
    XRRequestJSON,
    XRRequestString,
};

@interface XRAFNetworkTool : NSObject

/**
 *  GET
 *
 *  @param url           请求网址
 *  @param body          请求体
 *  @param header        请求头
 *  @param responseStyle 设置返回数据类型
 *  @param success       请求成功回调
 *  @param failure       请求失败回调
 */
+ (void)GETUrl:(NSString *)url
          body:(id)body
      headFile:(NSDictionary *)header
      response:(XRResponseStyle)responseStyle
       success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
       failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;


/**
 *  POST
 *
 *  @param url           请求网址
 *  @param body          body体
 *  @param bodyStyle     body体的类型
 *  @param header        请求头
 *  @param responseStyle 返回数据的类型
 *  @param success       请求成功回调
 *  @param failure       请求失败回调
 */
+ (void)POSTUrl:(NSString *)url
          body:(id)body
requestBodyStyle:(XRRequestStyle)bodyStyle
      headFile:(NSDictionary *)header
      response:(XRResponseStyle)responseStyle
       success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
       failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;

@end
